1. Field of the Invention
The present invention relates generally to a packet-processing apparatus and method, and more particularly, to a packet-processing apparatus with an agent and packet-processing method thereof.
2. Description of the Prior Art
Because of the development in technology and the demands from users, transmitting speed of the internet interface has been raised continuously. For example, the transmission rate of the wired local area network has already reached 1,000 Mbps and even 10 Gbps; while the transmission rate of the wireless local area network has also been developed from lower rate used in accordance with IEEE 802.11b to IEEE 802.11a/g and the even higher rate used in accordance with 802.11n standard; moreover, the wide area network has developed from 9,600 bps to the asymmetric digital subscriber line with the transmission rate of 8 Mbps and the very high data rate digital subscriber line with the transmission rate of 50 Mbps.
At the same time, with the increase of transmission rate of the internet, more applications or services based on the internet have been developed, such as voice over IP (VoIP), multimedia streaming, and multi-media on demand (MOD). These aim to provide our lives with more convenience, fulfillment, and safe service. However, said applications also cause the increased loading of internet equipments such as router, gateway, and servers.
Take a conventional router as an example, as shown in FIG. 1; it includes an input interface 21, a processing unit 23, and an output interface 25. The processing path of the router 2 is shown as the lines with arrow in FIG. 1. The packet is received by the input interface 21, processed by the processing unit 23, and output by the output interface 25, and is then transmitted to the destination. Please note that, in the prior art, the processing unit 23 is mostly a CPU, and the packet is processed by the processing unit 23 through software format. Therefore, when the router processes some of the above-mentioned application services and transmits the packets with high flow rate simultaneously, the service quality and efficiency are often reduced because of insufficient processing ability and overloading.
Accordingly, a router with offloading mechanism is developed, as shown in FIG. 2, which mainly includes an input interface 31, a processing unit 33, and an output interface 35. Furthermore, the router includes a lookup table 37 and an agent 39. The router 3 first establishes the lookup table 37, such as ACL, ARP, and NAPT, and then the agent 39 checks the lookup table 37 to process the packets to offload the loading of the processing unit 33. In the prior art, the establishing of lookup table can be performed by software (processing unit) or hardware circuit.
However, when a lookup table is established by software, the software engineer needs to spend a lot of time tracing the program codes to search for a suitable location for writing the codes established by the lookup table. Usually, there are more than one suitable locations dispersed in the whole program. The program code needs to be edited every time when a different CPU is used. Moreover, when processing the program codes edited by different software engineers, it takes a lot of time and labor to trace or rewrite the codes because of different habits of the engineers.
Furthermore, when the lookup table is established by hardware, certain logical circuits have to be first burned into the hardware, and then the hardware can establish the lookup table during the processing of packets based on the logical circuits. Although said method can increase the efficiency of packet processing, the content of lookup table is limited by the inflexible hardware circuits, and exceptions might happen to affect the processing accuracy and efficiency. Furthermore, because of the inflexible hardware circuits, the equipment provider can not add new functions to an existed hardware except to develop new hardware circuits, so that the cost is increased.
In summary, the development of a router or a pocket-processing apparatus with high processing efficiency and flexibility is necessary.